/*
 * @Autor: dc
 * @Date: 2022-03-09 17:26:43
 * @LastEditors: dc
 * @LastEditTime: 2022-03-11 15:36:27
 * @Description: 
 */
import React, { Component } from 'react';
import './index.css'


class index extends Component {
    todosSelectNum = () => {
        const { todos } = this.props;
        let arr = todos.filter(item => {
            return item.done
        })
        return arr.length
    }
    render() {
        const { is_allSelect, allTodos, todos, delComplete } = this.props
        return (
            <div className="footer">
                <div>
                    <input type="checkbox"
                        onChange={allTodos}
                        checked={is_allSelect} />
                    <span>已完成{this.todosSelectNum()}/全部{todos.length}</span>
                </div>
                <button onClick={delComplete}>清除已完成的任务</button>
            </div>
        );
    }
}

export default (index);